<?php	include_once('../config/db.php');
		include_once'../functions/loginLib.php';
	if(!isset($_SESSION['e_logged_in'])) 
	header('location:login.php');

	if(isset($_REQUEST['change'])){
		$array=array();
		if($_POST['pass']!==$_POST['pass_check']){
			$error=TRUE;
		}
		elseif($_POST['pass']=='' || $_POST['pass_check']==''){
			$invalid=TRUE;
		}
		else
			    $adminchange=admin_change($_REQUEST['pass']);
				$success=TRUE;				
		}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../style.css" type="text/css"/>
<title>Untitled Document</title>
</head>
<body>
<div id="header">
<div id="logo">
  <p>&nbsp;</p>
  <div id="apDiv1"><img src="../image/logo.png" alt="" width="500" height="100" /></div>
  <p>&nbsp;</p>
</div></div>
<div id="con-body">
<?php include 'navigation.php';?>
<p>Change Password:</p>
	<?php if(isset($error)):?>
    	<div id="error">Password do not match</div>
	<?php elseif(isset($invalid)):	?>
    <div id="error">Empty</div>
    <?php elseif(isset($success)):?>
    <div id="success">Successfully change</div>
    <?php endif;?>
<form id="form1" name="form1" method="post" action="">
  <label for="pass_check"></label>
  <table width="521" border="0">
    <tr>
      <td width="134">New Password: </td>
      <td width="377"><input name="pass" type="password" id="pass" size="30" /></td>
    </tr>
    <tr>
      <td>Confirm Password: </td>
      <td><input name="pass_check" type="password" id="pass_check" size="30" /></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input name="change" type="submit" class="blue" id="change" value="Change Password" /></td>
    </tr>
</table>
</form>
<p>&nbsp;</p></div>
</body>
</html>